Ext.namespace('VAS');
VAS.OpenURLPanel = Ext.extend(Ext.FormPanel, {
	initComponent : function() {
		var config={						
			width         : '100%', 
            frame         : true,    
		    minButtonWidth: 50,
            layout        : 'column',
            bodyStyle      : 'padding:5px 15px 0 '
		};
		Ext.apply(this, config);
		Ext.apply(this.initialConfig, config);
		VAS.OpenURLPanel.superclass.initComponent.apply(this, arguments);
	}
	,afterRender:function(){
		VAS.OpenURLPanel.superclass.afterRender.apply(this,arguments);
		 if(this.viewUrl!=='undefined'){
//		 	this.getForm().findField('idea').setValue('aa');
//		this.load({url:this.viewUrl,params:this.postdata});
		 }

	}
})
VAS.OpenURLWindow= function($config){
	var _this = this;
	_this.$config = $config;  
	_this.callback=function(){
		$config.grid.reload();
	    _this.close();
	};
	var thisConfig={};
	var key = $config.postData.id;
	var view_url =$config.viewUrl+"&id="+key;
    _this.contentForm = new Ext.Panel({
        frame:true,
		html: '<iframe id=mainframe src='+view_url+' frameborder=0  height='+parseInt($config.height-100)+' width=100%  scrolling="auto" ></iframe>'
		,height : $config.height
	});

	//_this.openUrlPanel = new VAS.OpenURLPanel({url:$config.saveUrl,viewUrl:$config.viewUrl,postdata:_this.getPostdata});
		thisConfig = {
			items : [_this.contentForm]
			,buttons:[
				{
	            	xtype:'comButton',
	            	text:'关闭',
	            	actionType:'close'
	            	,owner:_this,
	            	action:''
	               ,callback:_this.callback
	               ,postdata:{}
			    }]
		};
	var _config = $config || {};
	Ext.apply(_this, Ext.apply(thisConfig, _config));
	VAS.OpenURLWindow.superclass.constructor.call(_this);
};

Ext.extend(VAS.OpenURLWindow,Ext.Window,{	
	manager:wgroup });
